home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 January: Mac OS SDK / Dev.CD Jan 00 SDK1.toast / Development Kits / Mac OS / Apple Guide / Engineering / APISample / APISampleCW / Guide file / Assistant.nml < prev    next >
Encoding:
Text File  |  1994-07-25  |  14.0 KB  |  478 lines  |  [TEXT/MPS ]

  1. # 25-Jul-94
  2. # MoGuide Assistant
  3. # John Powers
  4.  
  5. # Compiled with Guide Maker v1.0f1c1.
  6.  
  7. # Setup defaults
  8.  
  9. <Version> "MoGuide Assistant 1.0.1", "1.0.1"
  10.  
  11. <Resource> "Buttons.rsrc", All
  12. <Resource> "AssistantLogo.rsrc", All
  13.  
  14. <Define Event> "GoStart", 'reno', 'help', 'stac'
  15. <Define Nav Button> "GoStart", 1103, 1113, 1123, GoStart()
  16. <Define Nav Button Set> "Standard Nav Btns", "GoStart"
  17. <Default Nav Button Set> "Standard Nav Btns"
  18.  
  19. <Define Event> "DoCoach", 'reno', 'help', 'doco'
  20. <Define Nav Button> "Mark", 1107, 1117, 1127, DoCoach()
  21. <Define Nav Button Set> "Coach Nav Btns", "GoStart", "Mark"
  22.  
  23. # My nml is in monaco 9,
  24. # but have Apple Guide display it in Espy Serif 10.
  25. <Define Format>    "GimmeEspy", column(6,6,330), "Espy Serif", 10
  26. <Default Format>    "GimmeEspy"
  27.  
  28. <Startup Window> SINGLE, HOWDY
  29. <Help Menu> "Assistant", HELP
  30.  
  31. # Howdy text
  32.  
  33. <Howdy> "Howdy from MoGuide Assistant"
  34.  
  35. <Define Text Block> "Howdy from MoGuide Assistant"
  36. A demonstation of Apple Guide API usage.
  37.  
  38. Author: John Powers
  39. File: Assistant.nml
  40. Date: 17-Mar-94
  41. <End Text Block>
  42.  
  43. # We want to specify the sequence ID's for our sequences
  44. # rather than let Nevada assign them. We use the ID's in
  45. # MoGuide to open the sequence.
  46.  
  47. <Build Sequence> "Open Art Window Topic", 3000
  48. <Build Sequence> "Art Window Oops", 3001
  49. <Build Sequence> "Demo Coach marks", 3004
  50. <Build Sequence> "Panel detection", 3006
  51. <Build Sequence> "Detect collision", 3008
  52. <Build Sequence> "Hotkey", 3012
  53. <Build Sequence> "Hotkey Glenn", 3013
  54. <Build Sequence> "Hotkey Bill", 3014
  55. <Build Sequence> "Hotkey Josh", 3015
  56. <Build Sequence> "Hotkey Pat", 3016
  57. <Build Sequence> "Hotkey Eileen", 3017
  58. <Build Sequence> "Hotkey Kay", 3018
  59.  
  60.  
  61. # Sequence Areas
  62.  
  63. <Topic Area>    "MoGuide Assistant"
  64. <Header>    "Browsing MoGuide"
  65. <Topic>    "Introduction", "Browsing Introduction"
  66. <Topic>    "Menus", "Browsing Menus"
  67. <Topic>    "Windows", "Browsing Windows"
  68. <Header>    "Demonstrations"
  69. <Topic>    "Open Art Window", "Open Art Window Topic"
  70. <Topic>    "Mark pieces", "Demo Coach marks"
  71. <Topic>    "Reset pieces", "Panel detection"
  72. <Topic>    "Detect collision", "Detect collision"
  73. <Topic>    "Hotkey", "Hotkey"
  74.  
  75. # An introduction of the Assistant.
  76.  
  77. <Define Sequence>    "Browsing Introduction"
  78.     <Panel>    "Intro to the Browse"
  79. <End Sequence>
  80.  
  81. # Use me, abuse me, but please browse me.
  82.  
  83. <Define Sequence>    "Browsing Menus"
  84.     <Panel>    "Menus"
  85.     <Panel>    "Menus - File"
  86.     <Panel>    "Menus - Edit"
  87.     <Panel>    "Menus - MoGuide"
  88.     <Panel>    "Menus - Window"
  89. <End Sequence>
  90.  
  91. <Define Sequence>    "Browsing Windows"
  92.     <Panel>    "Windows"
  93.     <Panel>    "Windows - Clipboard"
  94.     <Panel>    "Windows - Art Window"
  95.     <Panel>    "Windows - Feedback Window"
  96.     <Panel>    "Windows - Feedback Context"
  97.     <Panel>    "Windows - Feedback Coach"
  98.     <Panel>    "Windows - Feedback Event"
  99.     <Panel>    "Windows - Feedback Guide"
  100.     <Panel>    "Windows - Feedback Assistant"
  101. <End Sequence>
  102.  
  103. # Open Art Window for the user if necessary.
  104.  
  105. <Define Sequence>    "Open Art Window Topic"
  106.     <Panel>    "Intro"
  107.     <Start Making Sure> ArtWindowShowing(),"Art Window Oops"
  108.         <Panel> "Window is open"
  109.     <End Making Sure>
  110. <End Sequence>
  111.  
  112. # Mark objects that can be moved.
  113.  
  114. <Define Sequence>    "Demo Coach marks"
  115. <SNBS> "Coach Nav Btns"
  116.     <Panel>    "Coach marks"
  117.     <Start Making Sure> ArtWindowShowing(),"Art Window Oops"
  118.         <Panel>    "First mark"
  119.         <Panel>    "Second mark"
  120.         <Panel>    "Third mark"
  121.         <Panel>    "Fourth mark"
  122.     <End Making Sure>
  123. <End Sequence>
  124.  
  125. # Have MoGuide signal Apple Guide when a user action occurs.
  126.  
  127. # The following sequence waits for a user action.
  128. # A 'true' return from WaitCollision() would enable the
  129. # user to go to the next panel. However, 'true' is never returned.
  130. # Instead, Apple Guide sends the event in the WaitCollision
  131. # parameter when the user action occurs.  The
  132. # event moves us to the next panel.  We can't
  133. # use 'gonp' because the panel is evaluated
  134. # to false and would be skipped.
  135. # Also, a "Coach Mark" in the first panel
  136. # tells MoGuide that we are waiting for a collision.
  137.  
  138. <Define Sequence>    "Detect collision"
  139.     <Panel> "Collision intro"
  140.     <Start Making Sure> ArtWindowShowing(),"Art Window Oops"
  141.         <Panel>    "Waiting for collision"
  142.         <If>    WaitCollision('gons')
  143.             <Panel>    "Collision happened"
  144.             <If>    WaitCollision('gons')
  145.                 <Panel>    "Collision happened again"
  146.                 <If>    WaitCollision('gons')
  147.                     <Panel>    "Collision again and again"
  148.                 <End If>
  149.             <End If>
  150.         <Else>
  151.             <Panel>    "Skipped collision"
  152.         <End If>
  153.     <End Making Sure>
  154. <End Sequence>
  155.  
  156. # Let MoGuide know when a particular panel is showing.
  157.  
  158. <Define Sequence>    "Panel detection"
  159.     <Panel>    "Panel detection intro"
  160.     <Start Making Sure> ArtWindowShowing(),"Art Window Oops"
  161.         <Panel>    "Detect this panel"
  162.     <End Making Sure>
  163. <End Sequence>
  164.  
  165. # MoGuide calls up this sequence with a hot key.
  166.  
  167. <Define Sequence>    "Hotkey"
  168.     <Panel> "Hotkey intro"
  169. <End Sequence>
  170.  
  171. # MoGuide calls up this sequence with a hot key.
  172.  
  173. <Define Sequence>    "Hotkey Glenn"
  174.     <Panel> "Hotkey Glenn"
  175. <End Sequence>
  176.  
  177. # MoGuide calls up this sequence with a hot key.
  178.  
  179. <Define Sequence>    "Hotkey Bill"
  180.     <Panel> "Hotkey Bill"
  181. <End Sequence>
  182.  
  183. # MoGuide calls up this sequence with a hot key.
  184.  
  185. <Define Sequence>    "Hotkey Josh"
  186.     <Panel> "Hotkey Josh"
  187. <End Sequence>
  188.  
  189. # MoGuide calls up this sequence with a hot key.
  190.  
  191. <Define Sequence>    "Hotkey Pat"
  192.     <Panel> "Hotkey Pat"
  193. <End Sequence>
  194.  
  195. # MoGuide calls up this sequence with a hot key.
  196.  
  197. <Define Sequence>    "Hotkey Eileen"
  198.     <Panel> "Hotkey Eileen"
  199. <End Sequence>
  200.  
  201. # MoGuide calls up this sequence with a hot key.
  202.  
  203. <Define Sequence>    "Hotkey Kay"
  204.     <Panel> "Hotkey Kay"
  205. <End Sequence>
  206.  
  207. # Oops - Window must be open.
  208.  
  209. <Define Sequence>    "Art Window Oops"
  210.     <Panel>    "Open Art Window"
  211. <End Sequence>
  212.  
  213. # Panels
  214.  
  215. <Define Panel>    "Intro"
  216. I am your MoGuide Assistant, click the right arrow to proceed.
  217. <End Panel>
  218.  
  219. <Define Panel>    "Intro to the Browse"
  220. MoGuide is a demonstration of Apple Guide integration. The MoGuide Assistant (that's me) is an Apple Guide database for MoGuide.
  221.  
  222. That triangle button in the lower-left of this panel will take you back to the Assistant access window.
  223. <End Panel>
  224.  
  225. <Define Panel>    "Menus"
  226. MoGuide menus are:
  227.     File
  228.     Edit
  229.     MoGuide
  230.     Window
  231.  
  232. Click the right arrow to continue.
  233. <End Panel>
  234.  
  235. <Define Panel>    "Menus - File"
  236. You can use the File menu to open any Apple Guide database. If MoGuide opens the database, then you can also use the File menu to close the database.
  237.  
  238. Click the right arrow to continue.
  239. <Coach Mark> "MenuFile"
  240. <End Panel>
  241.  
  242. <Define Panel>    "Menus - Edit"
  243. The Edit menu is fully-functional, but MoGuide doesn't use it. Is that a contradiction?
  244.  
  245. Click the right arrow to continue.
  246. <Coach Mark> "MenuEdit"
  247. <End Panel>
  248.  
  249. <Define Panel>    "Menus - MoGuide"
  250. You can use the MoGuide menu to open and close Apple Guide databases specific to MoGuide. You can also use this menu to start and quit Apple Guide.
  251.  
  252. Click the right arrow to continue.
  253. <Coach Mark> "MenuMoGuide"
  254. <End Panel>
  255.  
  256. <Define Panel>    "Menus - Window"
  257. You can use the Window menu to open MoGuide windows, perform operations on the windows, and set context options.
  258. <Coach Mark> "MenuWindow"
  259. <End Panel>
  260.  
  261. <Define Panel>    "Windows"
  262. MoGuide windows are:
  263.     Clipboard
  264.     Art Window
  265.     Feedback Window
  266.  
  267. Click the right arrow to continue.
  268. <End Panel>
  269.  
  270. <Define Panel>    "Windows - Clipboard"
  271. The Clipboard window is fully-functional, but MoGuide doesn't use it. MoGuide used to use it, but that's long ago. Don't-ya just hate to waste code?
  272.  
  273. Click the right arrow to continue.
  274. <Coach Mark> "Clipboard"
  275. <End Panel>
  276.  
  277. <Define Panel>    "Windows - Art Window"
  278. The Art window is used for all the demonstrations. The objects in the Art window may be dragged around, shuffled, and reset.
  279.  
  280. Click the right arrow to continue.
  281. <On Panel Hide> OpenWindowFeedback()
  282. <Coach Mark> "Art"
  283. <End Panel>
  284.  
  285. <Define Panel>    "Windows - Feedback Window"
  286. The Feedback window shows when MoGuide receives a Coach, Context, or general event from itself or Apple Guide. The Guide field shows the status of Apple Guide.
  287.  
  288. Click the right arrow to continue.
  289. <Coach Mark> "FBWindow"
  290. <End Panel>
  291.  
  292. <Define Panel>    "Windows - Feedback Context"
  293. The Context event flashes when a context check query is received from Apple Guide. The context check is defined in the guide database and sent as panels are evaluated.
  294.  
  295. Click the right arrow to continue.
  296. <Coach Mark> "FBContext"
  297. <End Panel>
  298.  
  299. <Define Panel>    "Windows - Feedback Coach"
  300. The Coach event flashes when an object location query is received from Apple Guide. The Coach mark is defined in the guide database and sent by a Coach Mark command.
  301.  
  302. Click the right arrow to continue.
  303. <Coach Mark> "FBCoach"
  304. <End Panel>
  305.  
  306. <Define Panel>    "Windows - Feedback Event"
  307. The Event flashes when an Apple event is received from Apple Guide. The event is defined in the guide database and sent when a user does an action which includes the event.
  308.  
  309. Click the right arrow to continue.
  310. <Coach Mark> "FBEvent"
  311. <End Panel>
  312.  
  313. <Define Panel>    "Windows - Feedback Guide"
  314. The Guide field shows the status of Apple Guide as follows:
  315.     (none) - Standby (not running)
  316.     zzz… - Sleeping (running in the background)
  317.     accw - Access window showing
  318.     prew - Presentation window showing
  319.  
  320. Click the right arrow to continue.
  321. <Coach Mark> "FBGuide"
  322. <End Panel>
  323.  
  324. <Define Panel>    "Windows - Feedback Assistant"
  325. The Assistant button starts up the Assistant database (that's me).
  326. <Coach Mark> "FBAssistant"
  327. <End Panel>
  328.  
  329. <Define Panel>    "Window is open"
  330. Thank you for the open Art window.
  331. <End Panel>
  332.  
  333. <Define Panel>    "Open Art Window"
  334. The MoGuide Art window must be open to continue.  You can open it from the Window menu.  Or, would you like me to open it for you?
  335.  
  336. <Standard Button> "Do It For Me", CENTER, OpenWindowArt() 
  337. <On Panel Show> AdvanceMe()
  338. <End Panel>
  339.  
  340. <Define Panel>    "Coach marks"
  341. Pieces in the MoGuide Art window can be dragged to any location.  As you go from panel to panel, an object will be marked.  Apple Guide finds the object location by asking MoGuide.
  342.  
  343. Click the next arrow to proceed.
  344. <End Panel>
  345.  
  346. <Define Panel>    "First mark"
  347. Mark Glenn.
  348. <Coach Mark> "Glenn"
  349. <End Panel>
  350.  
  351. <Define Panel>    "Second mark"
  352. Mark Bill.
  353. <Coach Mark> "Bill"
  354. <End Panel>
  355.  
  356. <Define Panel>    "Third mark"
  357. Mark Josh.
  358. <Coach Mark> "Josh"
  359. <End Panel>
  360.  
  361. <Define Panel>    "Fourth mark"
  362. Mark Glenn and Josh.
  363. <Coach Mark> "Glenn-Josh"
  364. <End Panel>
  365.  
  366. <Define Panel>    "Panel detection intro"
  367. An event attached to the next panel signals MoGuide to reset the pieces in the Art window.
  368. <End Panel>
  369.  
  370. <Define Panel>    "Detect this panel"
  371. MoGuide Art window pieces are reset.
  372. <On Panel Show> ResetPieces()
  373. <End Panel>
  374.  
  375. <Define Panel>    "Collision intro"
  376. This sequence uses information from MoGuide.  When a collision happens, we advance to the next panel.
  377.  
  378. Go to the next panel to start collision detection.
  379. <End Panel>
  380.  
  381. <Define Panel>    "Waiting for collision"
  382. We are waiting for a collision.
  383. <On Panel Show> WaitCollision()
  384. <End Panel>
  385.  
  386. <Define Panel>    "Collision happened"
  387. The collision happened. Waiting for another collision.
  388. <End Panel>
  389.  
  390. <Define Panel>    "Collision happened again"
  391. The collision happened again. Waiting for another collision.
  392. <End Panel>
  393.  
  394. <Define Panel>    "Collision again and again"
  395. And again.  But never again.
  396. <On Panel Show> IgnoreCollision()
  397. <End Panel>
  398.  
  399. <Define Panel>    "Skipped collision"
  400. Couldn't wait for a collision, could you?
  401. <End Panel>
  402.  
  403. <Define Panel>    "Hotkey intro"
  404. Command-click an object in the Art window to learn more about that object. You can do this any time, not just when this Apple Guide panel is showing.
  405. <End Panel>
  406.  
  407. <Define Panel>    "Hotkey Glenn"
  408. This is Glenn.  Drag him to the other side of the Art window.  He may also move in a shuffle.
  409. <End Panel>
  410.  
  411. <Define Panel>    "Hotkey Bill"
  412. This is Bill.  You cannot drag Bill.  He may only move in a shuffle.
  413. <End Panel>
  414.  
  415. <Define Panel>    "Hotkey Josh"
  416. This is Josh.  Drag him to the other side of the Art window.  He may also move in a shuffle.
  417. <End Panel>
  418.  
  419. <Define Panel>    "Hotkey Pat"
  420. This is Pat.  Drag her to the other side of the Art window.  She may also move in a shuffle.
  421. <End Panel>
  422.  
  423. <Define Panel>    "Hotkey Eileen"
  424. This is Eileen.  You cannot drag Eileen.  She may only move in a shuffle.
  425. <End Panel>
  426.  
  427. <Define Panel>    "Hotkey Kay"
  428. This is Kay.  Drag her to the other side of the Art window.  She may also move in a shuffle.
  429. <End Panel>
  430.  
  431. # Events that MoGuide understands.
  432.  
  433. <Define Event> "OpenWindowArt",        'MoG1', 'MoHC', 'MoSa'
  434. <Define Event> "CloseWindowArt",        'MoG1', 'MoHC', 'MoCa'
  435. <Define Event> "OpenWindowFeedback",    'MoG1', 'MoHC', 'MoSf'
  436. <Define Event> "CloseWindowFeedback",    'MoG1', 'MoHC', 'MoCf'
  437. <Define Event> "ResetPieces",            'MoG1', 'MoHC', 'MoRs'
  438. <Define Event> "ShufflePieces",        'MoG1', 'MoHC', 'MoSh'
  439. <Define Event> "QuitMoGuide",            'MoG1', 'MoHC', 'MoQa'
  440. <Define Event> "WaitCollision",        'MoG1', 'MoHC', 'MoAw'
  441. <Define Event> "IgnoreCollision",        'MoG1', 'MoHC', 'MoAi'
  442. <Define Event> "AdvanceMe",            'MoG1', 'MoHC', 'MoAa'
  443.  
  444. # Text Regions
  445.  
  446. #<Define Text Region> "App content", Column(10, 10, 330), "Espy Sans", 10, plain, left, false
  447.  
  448. # Coach marks
  449.  
  450. <Define Object Coach> "Glenn",    'MoG1', redCircle, "Glenn"
  451. <Define Object Coach> "Bill",        'MoG1', yellowX, "Bill"
  452. <Define Object Coach> "Josh",        'MoG1', redUnderline, "Josh"
  453. <Define Object Coach> "Pat",        'MoG1', redCircle, "Pat"
  454. <Define Object Coach> "Eileen",    'MoG1', yellowX, "Eileen"
  455. <Define Object Coach> "Kay",        'MoG1', redUnderline, "Kay"
  456. <Define Object Coach> "Glenn-Josh",    'MoG1', redArrow(1,3), "Glenn-Josh"
  457.  
  458. <Define Menu Coach> "MenuFile",    'MoG1', redCircle, "File"
  459. <Define Menu Coach> "MenuEdit",    'MoG1', redCircle, "Edit"
  460. <Define Menu Coach> "MenuMoGuide",    'MoG1', redCircle, "MoGuide"
  461. <Define Menu Coach> "MenuWindow",    'MoG1', redCircle, "Window"
  462.  
  463. <Define Window Coach> "Clipboard", 'MoG1', redCircle, "Clipboard", TITLEBAR
  464. <Define Window Coach> "Art", 'MoG1', redCircle, "Art", TITLEBAR
  465. <Define Window Coach> "FBWindow", 'MoG1', redCircle, "Feedback", TITLEBAR
  466. <Define Window Coach> "FBContext", 'MoG1', redCircle, "Feedback", Rect(6, 10, 11, 100)
  467. <Define Window Coach> "FBCoach", 'MoG1', redCircle, "Feedback", Rect(18, 10, 23, 100)
  468. <Define Window Coach> "FBEvent", 'MoG1', redCircle, "Feedback", Rect(30, 10, 36, 100)
  469. <Define Window Coach> "FBGuide", 'MoG1', redCircle, "Feedback", Rect(42, 10, 46, 100)
  470. <Define Window Coach> "FBAssistant", 'MoG1', redCircle, "Feedback", Rect(58, 30, 66, 130)
  471.  
  472. # Context checks
  473.  
  474. <Define Context Check> "ArtWindowShowing", 'WiYg', 'MoG1'
  475. <Define Context Check> "WaitCollision", 'WiYe', 'MoG1', OSTYPE
  476.  
  477.  
  478.